package com.egene.tw.api;

import com.egene.tw.model.User;
import com.egene.tw.network.ApiConstant;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;

import static com.egene.tw.network.ApiHttpClient.post;

public class SignsApi {
    //    public final static String API_URL = ApiConstant.API_URL;
    public final static String API_URL = ApiConstant.BASE_URL + "/api/APPService.ashx";


    //    健康数据接口列表说明

    //1、计步数据接口
//    http://103.17.9.110:9100/api/APPService.ashx?cmd=ServerHandler.SaveStepInfo&userid=ab66f047f73341448f6d1351826e97aa&device=IOS&stepnumber=1200&date=2018-03-15 14:06
//    参数说明：userid这个不用说，device参数:安桌传Android，苹果传IOS,stepnumber参数传计步数，纯数字，别带ABC英文等字符
    public static void saveStepInfo(String userid, int stepnumber, String date, AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("cmd", "ServerHandler.SaveStepInfo");
        params.put("userid", userid);
        params.put("device", "Android");
        params.put("stepnumber", stepnumber);
        params.put("date", date);
        post(API_URL, params, handler);
    }


    //2、睡眠数据接口
//    http://103.17.9.110:9100/api/APPService.ashx?cmd=ServerHandler.SaveSleepInfo&userid=ab66f047f73341448f6d1351826e97aa&device=IOS&sleephour=7
//    参数说明：userid这个不用说，device参数:安桌传Android，苹果传IOS,sleephour参数传睡眠数据，纯数字或小数，别带ABC英文等字符
    public static void saveSleepInfo(String userid, int sleephour, String date, AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("cmd", "ServerHandler.SaveSleepInfo");
        params.put("userid", userid);
        params.put("device", "Android");
        params.put("sleephour", sleephour);
        params.put("date", date);
        post(API_URL, params, handler);
    }


    //3、心率数据接口
//    http://103.17.9.110:9100/api/APPService.ashx?cmd=ServerHandler.SaveHeartRateInfo&userid=ab66f047f73341448f6d1351826e97aa&device=IOS&heartrate=107
//    参数说明：userid这个不用说，device参数:安桌传Android，苹果传IOS,heartrate参数传心率次数，纯数字或小数，别带ABC英文等字符
    public static void saveHeartRateInfo(String userid, int heartrate, String date, AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("cmd", "ServerHandler.SaveHeartRateInfo");
        params.put("userid", userid);
        params.put("device", "Android");
        params.put("heartrate", heartrate);
        params.put("date", date);
        post(API_URL, params, handler);
    }


    //4、血壓数据接口
//    http://103.17.9.110:9100/api/APPService.ashx?cmd=ServerHandler.SaveBloodPressureInfo&userid=ab66f047f73341448f6d1351826e97aa&device=IOS&systolic=90
//    参数说明：userid这个不用说，device参数:安桌传Android，苹果传IOS,systolic参数传收縮壓，纯数字或小数，别带ABC英文等字符
    public static void saveBloodPressureInfo(String userid, int diastolic, int systolic, String date, AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("cmd", "ServerHandler.SaveBloodPressureInfo");
        params.put("userid", userid);
        params.put("device", "Android");
        params.put("diastolic", diastolic);
        params.put("systolic", systolic);
        params.put("date", date);
        post(API_URL, params, handler);
    }


    //5、血氧数据接口
//    http://103.17.9.110:9100/api/APPService.ashx?cmd=ServerHandler.SaveBloodOXInfo&userid=ab66f047f73341448f6d1351826e97aa&device=IOS&bloodox=90
//    参数说明：userid这个不用说，device参数:安桌传Android，苹果传IOS,bloodox参数传血氧，纯数字或小数，别带ABC英文等字符
    public static void saveBloodOXInfo(String userid, int bloodox, String date, AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("cmd", "ServerHandler.SaveBloodOXInfo");
        params.put("userid", userid);
        params.put("device", "Android");
        params.put("bloodox", bloodox);
        params.put("date", date);
        post(API_URL, params, handler);
    }


    //6、疲勞数据接口
//    http://103.17.9.110:9100/api/APPService.ashx?cmd=ServerHandler.SaveFatigueInfo&userid=ab66f047f73341448f6d1351826e97aa&device=IOS&fatigue=??
//    参数说明：userid这个不用说，device参数:安桌传Android，苹果传IOS,fatigue参数传低疲劳或高疲劳或0，1，待联调看数据格式
    public static void saveFatigueInfo(String userid, int fatigue, String date, AsyncHttpResponseHandler handler) {
        RequestParams params = new RequestParams();
        params.put("cmd", "ServerHandler.SaveFatigueInfo");
        params.put("userid", userid);
        params.put("device", "Android");
        params.put("fatigue", fatigue);
        params.put("date", date);
        post(API_URL, params, handler);
    }
}
